package com.hundsun.cprs.yyt.response;

import java.io.Serializable;

import com.hundsun.cprs.yyt.common.enums.EnumCommonCode;


public class BaseResponse implements Serializable {

	private static final long serialVersionUID = -8386282767332441300L;

	private boolean success = true;
	
	private int errorNo = EnumCommonCode.COMMON_SUCCESS.getErrorNo();
	
	private String errorDesc = EnumCommonCode.COMMON_SUCCESS.getErrorInfo();
	
	public BaseResponse(){
		this.errorDesc = "success";
	}
	
	public BaseResponse(int errorNo,String errorDesc){
		if(errorNo != EnumCommonCode.COMMON_SUCCESS.getErrorNo())
			this.success = false;
		this.errorDesc = errorDesc;
		this.errorNo = errorNo;
	}

	public boolean isSuccess() {
		return success;
	}

	public void setSuccess(boolean success) {
		this.success = success;
	}

	public int getErrorNo() {
		return errorNo;
	}

	public void setErrorNo(int errorNo) {
		this.errorNo = errorNo;
		if(this.errorNo != 0)
			this.success = false;
	}

	public String getErrorDesc() {
		return errorDesc;
	}

	public void setErrorDesc(String errorDesc) {
		this.errorDesc = errorDesc;
	}
	
}
